<template>
  <Dialog
    :show="dialogConfig.show"
    :title="dialogConfig.title"
    :buttons="dialogConfig.buttons"
    :showCancel="true"
    @close="dialogConfig.show = false"
    :width="1200+'px'"
  >
    <div class="noticeDetail">
        <div class="top">
            <div class="item"><h4>{{formData.title}}</h4>
            </div>
            <div class="item">
                    <div>发布人：{{ formData.name }}</div>
                    <div >发布时间：{{ formData.publishTime }}</div>
            </div>
        </div>
        <div class="content">
                <div v-html="formData.content">
                </div>
        </div>
    </div>
  </Dialog>
</template>

<script setup>
import { ref, reactive, getCurrentInstance, nextTick } from "vue";
const { proxy } = getCurrentInstance();

const api = {
  loadNoticeById: "/noticeInfo/getNoticeInfoById",
};

const props = defineProps({
  treeData: {
    type: Array,
    default: [],
  },
});



const dialogConfig = ref({
  show: false,
  title: "通知详情",
  buttons: [

  ],
});

const formData = ref({});
const formDataRef = ref();


const showDetail = (data) => {
  dialogConfig.value.show = true;
  nextTick(() => {
    formData.value = data;
  });
};

defineExpose({
    showDetail,
});


</script>

<style lang="scss" scoped>

    .noticeDetail{
        overflow-y: scroll;
        height: 600px;
        padding: 0 10px 0 0;
        .top{
            display: flex;
            flex-direction: column;
            height: 100px;
            .item{
                margin: auto;
            }
        }
        .content{
            position: relative;
            height: 500px;
        }

    }
</style>
